import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    isLoading: false,
    loadingText: '',
    toastModel: false,
    toastText: ''
  },
  mutations: {
    showLoading (state, text) {
      state.isLoading = true
      state.loadingText = text
    },
    hideLoading (state) {
      state.isLoading = false
    },
    showToast (state, text) {
      state.toastModel = true
      state.toastText = '<span style="color:#EEEDED;font-size: 10pt;">' + text + '</span>'
    }
  }
})

export default store
